#ifndef QLIVEBROADCASTROOM_H
#define QLIVEBROADCASTROOM_H

#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QMouseEvent>
#include <QEvent>
#include "QReadqss.h"
#include "opencv2/opencv.hpp"
#include <iostream>
#include <QDebug>
#include <QTimer>

using namespace std;
using namespace cv;

class QReadQSS;
class QLiveBroadcastRoom : public QWidget
{
    Q_OBJECT
public:
    explicit QLiveBroadcastRoom(QWidget *parent = nullptr);

    QLabel *LabelOfView;
    QWidget *WidgetOfBtns;
    QPushButton *BtnOfStartlive;
    QPushButton *BtnOfSettings;

    QWidget *WidgetOfWindowsTitleBar;
    QPushButton *CloseBtn;
    QPushButton *MaximizeBtn;
    QPushButton *MinimizeBtn;
    QVBoxLayout *LayoutOfAll;
    QHBoxLayout *LayoutOfUp;
    QHBoxLayout *LayoutOfDown;

    void importFrame();
signals:

protected:
    bool eventFilter(QObject *obj, QEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
private:
    bool mDrag;             //是否在拖动
    QPoint mDragPos;        //拖动起始点
    bool mIsMax;            //当前是否最大化
    VideoCapture capture;
    QTimer *timer;
    Mat frame;
    bool isCamera = 0;
public slots:
    void SLOTFunOfMaximize();
};

#endif // QLIVEBROADCASTROOM_H
